/**
 * Created by imouze on 2017-10-26.
 */

const Remote = require('../remote');
const urls = require('../config/urls.json');

class User {
    constructor(options) {
        this.options = options = options || {};
        this.remote = new Remote();
        
        if(options.cookie){
            this.remote.addHeaders({
                'Cookie': 'JSESSIONID=' + options.Cookie
            });
        }
    }
    
    /**
     * 获取用户信息
     * @param params
     * @returns {Promise.<{}>}
     */
    async getUserInfo(params) {
        let result = {};
        
        await this.remote.request('POST', urls.user.userinfo, params, res => {
            result = res;
        });
        
        return result;
    }
    
    async getUserList(params){
        let result = {};
        await this.remote.request('POST', url.user.userlist, params, res => {
        
        });
        
        return result;
    }
}


module.exports = User;